package com.cloudshop.service.goods.feign;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * User FallBackFactory.
 *
 * @author 宫新程
 * @since 2019/3/29 17:39
 */
@Component
public class UserFeignFallbackFactory implements FallbackFactory<UserFeign> {

  @Override
  public UserFeign create(Throwable throwable) {
    return new UserFeign() {
      @Override
      public Object getUserName(String username) {
        throw new RuntimeException(throwable);
      }
    };
  }
}
